edgfe-based tools) whine less.
coastexp: fix bounds violation on monthString
delgpl: fix error text on fatal()
geoniche: tweak terminator
google: make seial an int, not long.
gpx: include xmlgeneric
lowrance: fix signedness writing waypoint count
mapsource make le_f(read|write)64 explictly void
nmea: add gratituous initialization
overlay: explicitly zero zome values
position: bloat 'nop' functions to eliminate need for cast.
shape: close->SHPClose. misc warning fixes
tpg: include ctype
xmlgeneric.h: add many protos.
yearString[4] = '\0';
t.tm_year = atoi(yearString) - 1900;
strncpy(monthString, currentMark->created+4, 2);
- monthString[3] = '\0';
+ monthString[2] = '\0';
t.tm_mon = atoi(monthString) - 1;
strncpy(dayString, currentMark->created+6, 2);
dayString[2] = '\0';
{
gplfile_in = xfopen(fname, "rb", MYNAME);
if (sizeof(struct gpl_point) != 56) {
- fatal(MYNAME, ": gpl_point is %d instead of 56.\n",
+ fatal(MYNAME ": gpl_point is %d instead of 56.\n",
sizeof(struct gpl_point));
}
}
"Database name (filename)", NULL, ARGTYPE_STRING },
{"category", &Arg_category,
"Category name (Cache)", NULL, ARGTYPE_STRING },
- {0, 0, 0, 0 }
+ {0, 0, 0, 0, 0 }
};
#define ARG_FREE(X) do { if (X) { xfree(X); X = NULL; } } while (0)
FILE *fd;
-static long serial = 0;
+static int serial = 0;
#define MYNAME "google"
#define MY_CBUF 4096
*/
#include "defs.h"
+#include "xmlgeneric.h"
#ifndef NO_EXPAT
#include <expat.h>
static XML_Parser psr;
int alt = wpt->altitude;
/* our personal waypoint counter */
- my_fwrite2(&waypt_out_count, file_out);
+ my_fwrite2((short *) &waypt_out_count, file_out);
waypt_out_count++;
Lat = lat_deg_to_mm(wpt->latitude);
* A wrapper to ensure the doubles we fwrite are in correct endianness.
*/
+void
le_fwrite64(void *ptr, int sz, int ct, FILE *stream)
{
unsigned char cbuf[8];
fwrite(cbuf, 8, 1, stream);
}
+void
le_fread64(void *ptr, int sz, int ct, FILE *stream)
{
unsigned char cbuf[8];
nmea_wr_deinit,
nmea_read,
nmea_write,
+ NULL,
NULL
};
char *pstr;
int keyw,i;
double rwert;
- route_head *route_head;
+ route_head *route_head = NULL;
waypoint *wpt;
int sym_cnt;
queue *elem, *tmp;
waypoint *waypointp;
int i;
- double lat1, lon1, lat2, lon2;
+ double lat1,lon1,lat2,lon2;
double lats,lons,late,lone;
double dist,d,dd;
+ lat1 = lon1 = lat2 = lon2 = 0.0;
+ lats = lons = late = lone = 0.0;
dist = 0.0;
i = 0;
QUEUE_FOR_EACH(&(hd->waypoint_list), elem, tmp)
}
static void
-position_noop(){
+position_noop_w(const waypoint *w)
+{
+}
+
+static void
+position_noop_t(const route_head *h)
+{
}
void position_process()
if (i)
position_runqueue(&waypt_head, i, wptdata);
- route_disp_all(position_process_route, position_noop, position_noop);
- track_disp_all(position_process_route, position_noop, position_noop);
+ route_disp_all(position_process_route, position_noop_t, position_noop_w);
+ track_disp_all(position_process_route, position_noop_t, position_noop_w);
}
void
void
my_rd_deinit(void)
{
- close (ihandle);
+ SHPClose (ihandle);
}
void
}
void
-poly_init()
+poly_init(const route_head *h)
{
int ct = route_waypt_count();
polybufx = xcalloc(ct, sizeof(double));
}
void
-poly_deinit()
+poly_deinit(const route_head *h)
{
SHPObject *shpobject;
shpobject = SHPCreateSimpleObject(SHPT_ARC, route_waypt_count(),
}
route_disp_all(poly_init, poly_deinit, poly_point);
break;
+ case rtedata:
+ fatal(MYNAME ":Routes are not supported\n");
+ break;
}
}
my_wr_deinit,
my_read,
my_write,
+ NULL,
NULL
};
#include "defs.h"
#include <string.h>
+#include <ctype.h>
#include "jeeps/gpsmath.h" /* for datum conversions */
#define MYNAME "TPG"
/*
Header for our common utilities for XML-based formats.
- Copyright (C) 2004 Robert Lipe, robertlipe@usa.net
+ Copyright (C) 2004, 2005 Robert Lipe, robertlipe@usa.net
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
void write_xml_entity(FILE *ofd, const char *indent,
- const char *tag, const char *value);
+ const char *tag, const char *value);
+void write_xml_entity_begin0(FILE *ofd, const char *indent,
+ const char *tag);
+void write_xml_entity_begin1(FILE *ofd, const char *indent, const char *tag,
+ const char *attr1, const char *attrval1);
+void write_xml_entity_begin2(FILE *ofd, const char *indent, const char *tag,
+ const char *attr1, const char *attrval1,
+ const char *attr2, const char *attrval2);
+void write_xml_entity_end(FILE *ofd, const char *indent, const char *tag);
void write_optional_xml_entity(FILE *ofd, const char *indent,
- const char *tag, const char *value);
+ const char *tag, const char *value);
void xml_write_time(FILE *ofd, const time_t timep, char *elname);
+void xml_fill_in_time(char *time_string, const time_t timep,
+ int long_or_short);
+void write_xml_header(FILE *ofd);
void xml_init(const char *fname, xg_tag_mapping *tbl);
void xml_read(void);